package com.mydemo.likedy.Utils;

import cn.hutool.captcha.CaptchaUtil;
import cn.hutool.captcha.CircleCaptcha;
import cn.hutool.captcha.LineCaptcha;
import cn.hutool.captcha.ShearCaptcha;

/**
 * 生成验证码
 * 传入验证码的长宽字符以及干扰度
 */
public class SedCaptchaUtil {


    /**
     * 生成线图形干扰验证码
     *
     * @param width
     * @param high
     * @param codeCount
     * @param lineCount
     * @return
     */
    public static LineCaptcha CreateLineCaptcha(int width, int high, int codeCount, int lineCount) {
        return CaptchaUtil.createLineCaptcha(width, high, codeCount, lineCount);
    }

    /**
     * 生成圆图形干扰验证码
     *
     * @param width
     * @param high
     * @param codeCount
     * @param lineCount
     * @return
     */
    public static CircleCaptcha CreateCircleCaptcha(int width, int high, int codeCount, int lineCount, String uuid) {
        return CaptchaUtil.createCircleCaptcha(width, high, codeCount, lineCount);
    }

    /**
     * 生成扭曲图形干扰验证码
     *
     * @param width
     * @param high
     * @param codeCount
     * @param lineCount
     * @return
     */
    public static ShearCaptcha CreateShearCaptcha(int width, int high, int codeCount, int lineCount) {
        return CaptchaUtil.createShearCaptcha(width, high, codeCount, lineCount);
    }
}
